package org.qiyu.live.id.generate.provider.service.bo;

import java.util.concurrent.atomic.AtomicLong;

public class LocalSeqIdBO {

    /**
     *在内存中记录的当前有序id的值
     */

    //currentStart=10000    nextThreshold=11000   step=1000    currentNum=10000  10001  10002   10003
    //currentStart=11000    nextThreshold=12000   step=1000    currentNum=11000  11001  11002

    //通过id   获取----》localSeqIdBO               10001    10002
    private AtomicLong currentNum;
    private int id;
    private Long currentStart;
    private Long nextThreshold;

    public AtomicLong getCurrentNum() {
        return currentNum;
    }

    public void setCurrentNum(AtomicLong currentNum) {
        this.currentNum = currentNum;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Long getCurrentStart() {
        return currentStart;
    }

    public void setCurrentStart(Long currentStart) {
        this.currentStart = currentStart;
    }

    public Long getNextThreshold() {
        return nextThreshold;
    }

    public void setNextThreshold(Long nextThreshold) {
        this.nextThreshold = nextThreshold;
    }

    @Override
    public String toString() {
        return "LocalSeqIdBO{" +
                "currentNum=" + currentNum +
                ", id=" + id +
                ", currentStart=" + currentStart +
                ", nextThreshold=" + nextThreshold +
                '}';
    }
}
